<!DOCTYPE html>



  


<html class="theme-next muse use-motion" lang="zh-CN">
<head>
  <meta charset="UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"/>
<meta name="theme-color" content="#222">









<meta http-equiv="Cache-Control" content="no-transform" />
<meta http-equiv="Cache-Control" content="no-siteapp" />
















  
  
  <link href="/essay/lib/fancybox/source/jquery.fancybox.css?v=2.1.5" rel="stylesheet" type="text/css" />







<link href="/essay/lib/font-awesome/css/font-awesome.min.css?v=4.6.2" rel="stylesheet" type="text/css" />

<link href="/essay/css/main.css?v=5.1.4" rel="stylesheet" type="text/css" />


  <link rel="apple-touch-icon" sizes="180x180" href="/essay/images/apple-touch-icon-next.png?v=5.1.4">


  <link rel="icon" type="image/png" sizes="32x32" href="/essay/images/favicon-32x32-next.png?v=5.1.4">


  <link rel="icon" type="image/png" sizes="16x16" href="/essay/images/favicon-16x16-next.png?v=5.1.4">


  <link rel="mask-icon" href="/essay/images/logo.svg?v=5.1.4" color="#222">





  <meta name="keywords" content="Hexo, NexT" />










<meta name="description" content="编辑软件Typora(语法 markdown) BFC规则Float浮动对于块级元素，块级元素会无视浮动元素，当子级发生浮动的时候，父级会有高度塌陷的现象 ，需要清除浮动（父级高度为0）。 display:flow-root leftrightPosition定位staticfixedabsolute脱离文档流，并且所有元素都不认识他 relativeleft right top bottom">
<meta property="og:type" content="website">
<meta property="og:title" content="小桃子的日常分享">
<meta property="og:url" content="http://yoursite.com/Float%E6%B5%AE%E5%8A%A8.html">
<meta property="og:site_name" content="小桃子的日常分享">
<meta property="og:description" content="编辑软件Typora(语法 markdown) BFC规则Float浮动对于块级元素，块级元素会无视浮动元素，当子级发生浮动的时候，父级会有高度塌陷的现象 ，需要清除浮动（父级高度为0）。 display:flow-root leftrightPosition定位staticfixedabsolute脱离文档流，并且所有元素都不认识他 relativeleft right top bottom">
<meta property="og:locale" content="zh_CN">
<meta property="article:published_time" content="2020-02-21T09:46:45.509Z">
<meta property="article:modified_time" content="2020-02-21T09:46:45.509Z">
<meta property="article:author" content="小桃子">
<meta name="twitter:card" content="summary">



<script type="text/javascript" id="hexo.configurations">
  var NexT = window.NexT || {};
  var CONFIG = {
    root: '/essay/',
    scheme: 'Muse',
    version: '5.1.4',
    sidebar: {"position":"left","display":"post","offset":12,"b2t":false,"scrollpercent":false,"onmobile":false},
    fancybox: true,
    tabs: true,
    motion: {"enable":true,"async":false,"transition":{"post_block":"fadeIn","post_header":"slideDownIn","post_body":"slideDownIn","coll_header":"slideLeftIn","sidebar":"slideUpIn"}},
    duoshuo: {
      userId: '0',
      author: 'Author'
    },
    algolia: {
      applicationID: '',
      apiKey: '',
      indexName: '',
      hits: {"per_page":10},
      labels: {"input_placeholder":"Search for Posts","hits_empty":"We didn't find any results for the search: ${query}","hits_stats":"${hits} results found in ${time} ms"}
    }
  };
</script>



  <link rel="canonical" href="http://yoursite.com/Float浮动.html"/>





  <title> | 小桃子的日常分享</title>
  








<meta name="generator" content="Hexo 4.2.0"></head>

<body itemscope itemtype="http://schema.org/WebPage" lang="zh-CN">

  
  
    
  

  <div class="container sidebar-position-left page-post-detail">
    <div class="headband"></div>

    <header id="header" class="header" itemscope itemtype="http://schema.org/WPHeader">
      <div class="header-inner"><div class="site-brand-wrapper">
  <div class="site-meta ">
    

    <div class="custom-logo-site-title">
      <a href="/essay/"  class="brand" rel="start">
        <span class="logo-line-before"><i></i></span>
        <span class="site-title">小桃子的日常分享</span>
        <span class="logo-line-after"><i></i></span>
      </a>
    </div>
      
        <p class="site-subtitle"></p>
      
  </div>

  <div class="site-nav-toggle">
    <button>
      <span class="btn-bar"></span>
      <span class="btn-bar"></span>
      <span class="btn-bar"></span>
    </button>
  </div>
</div>

<nav class="site-nav">
  

  
    <ul id="menu" class="menu">
      
        
        <li class="menu-item menu-item-home">
          <a href="/essay/" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-question-circle"></i> <br />
            
            Home
          </a>
        </li>
      
        
        <li class="menu-item menu-item-archives">
          <a href="/essay/archives/" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-question-circle"></i> <br />
            
            Archives
          </a>
        </li>
      

      
    </ul>
  

  
</nav>



 </div>
    </header>

    <main id="main" class="main">
      <div class="main-inner">
        <div class="content-wrap">
          <div id="content" class="content">
            

  <div id="posts" class="posts-expand">
    
    
    
    <div class="post-block page">
      <header class="post-header">

	<h1 class="post-title" itemprop="name headline"></h1>



</header>

      
      
      
      <div class="post-body">
        
        
          <p>编辑软件Typora(语法 markdown)</p>
<h2 id="BFC规则"><a href="#BFC规则" class="headerlink" title="BFC规则"></a>BFC规则</h2><h1 id="Float浮动"><a href="#Float浮动" class="headerlink" title="Float浮动"></a>Float浮动</h1><p>对于块级元素，块级元素会无视浮动元素，当子级发生浮动的时候，父级会有高度塌陷的现象</p>
<p>，需要清除浮动（父级高度为0）。</p>
<p>display:flow-root</p>
<h2 id="left"><a href="#left" class="headerlink" title="left"></a>left</h2><h2 id="right"><a href="#right" class="headerlink" title="right"></a>right</h2><h1 id="Position定位"><a href="#Position定位" class="headerlink" title="Position定位"></a>Position定位</h1><h2 id="static"><a href="#static" class="headerlink" title="static"></a>static</h2><h2 id="fixed"><a href="#fixed" class="headerlink" title="fixed"></a>fixed</h2><h2 id="absolute"><a href="#absolute" class="headerlink" title="absolute"></a>absolute</h2><p>脱离文档流，并且所有元素都不认识他</p>
<h2 id="relative"><a href="#relative" class="headerlink" title="relative"></a>relative</h2><p>left right top bottom</p>

        
      </div>
      
      
      
    </div>
    
    
    
  </div>


          </div>
          


          

  



        </div>
        
          
  
  <div class="sidebar-toggle">
    <div class="sidebar-toggle-line-wrap">
      <span class="sidebar-toggle-line sidebar-toggle-line-first"></span>
      <span class="sidebar-toggle-line sidebar-toggle-line-middle"></span>
      <span class="sidebar-toggle-line sidebar-toggle-line-last"></span>
    </div>
  </div>

  <aside id="sidebar" class="sidebar">
    
    <div class="sidebar-inner">

      

      
        <ul class="sidebar-nav motion-element">
          <li class="sidebar-nav-toc sidebar-nav-active" data-target="post-toc-wrap">
            Table of Contents
          </li>
          <li class="sidebar-nav-overview" data-target="site-overview-wrap">
            Overview
          </li>
        </ul>
      

      <section class="site-overview-wrap sidebar-panel">
        <div class="site-overview">
          <div class="site-author motion-element" itemprop="author" itemscope itemtype="http://schema.org/Person">
            
              <p class="site-author-name" itemprop="name">小桃子</p>
              <p class="site-description motion-element" itemprop="description"></p>
          </div>

          <nav class="site-state motion-element">

            
              <div class="site-state-item site-state-posts">
              
                <a href="/essay/archives/">
              
                  <span class="site-state-item-count">1</span>
                  <span class="site-state-item-name">posts</span>
                </a>
              </div>
            

            

            

          </nav>

          

          

          
          

          
          

          

        </div>
      </section>

      
      <!--noindex-->
        <section class="post-toc-wrap motion-element sidebar-panel sidebar-panel-active">
          <div class="post-toc">

            
              
            

            
              <div class="post-toc-content"><ol class="nav"><li class="nav-item nav-level-2"><a class="nav-link" href="#BFC规则"><span class="nav-number">1.</span> <span class="nav-text">BFC规则</span></a></li></ol></li><li class="nav-item nav-level-1"><a class="nav-link" href="#Float浮动"><span class="nav-number"></span> <span class="nav-text">Float浮动</span></a><ol class="nav-child"><li class="nav-item nav-level-2"><a class="nav-link" href="#left"><span class="nav-number">1.</span> <span class="nav-text">left</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#right"><span class="nav-number">2.</span> <span class="nav-text">right</span></a></li></ol></li><li class="nav-item nav-level-1"><a class="nav-link" href="#Position定位"><span class="nav-number"></span> <span class="nav-text">Position定位</span></a><ol class="nav-child"><li class="nav-item nav-level-2"><a class="nav-link" href="#static"><span class="nav-number">1.</span> <span class="nav-text">static</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#fixed"><span class="nav-number">2.</span> <span class="nav-text">fixed</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#absolute"><span class="nav-number">3.</span> <span class="nav-text">absolute</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#relative"><span class="nav-number">4.</span> <span class="nav-text">relative</span></a></li></ol></div>
            

          </div>
        </section>
      <!--/noindex-->
      

      

    </div>
  </aside>


        
      </div>
    </main>

    <footer id="footer" class="footer">
      <div class="footer-inner">
        <div class="copyright">&copy; <span itemprop="copyrightYear">2020</span>
  <span class="with-love">
    <i class="fa fa-user"></i>
  </span>
  <span class="author" itemprop="copyrightHolder">小桃子</span>

  
</div>


  <div class="powered-by">Powered by <a class="theme-link" target="_blank" href="https://hexo.io">Hexo</a></div>



  <span class="post-meta-divider">|</span>



  <div class="theme-info">Theme &mdash; <a class="theme-link" target="_blank" href="https://github.com/iissnan/hexo-theme-next">NexT.Muse</a> v5.1.4</div>




        







        
      </div>
    </footer>

    
      <div class="back-to-top">
        <i class="fa fa-arrow-up"></i>
        
      </div>
    

    

  </div>

  

<script type="text/javascript">
  if (Object.prototype.toString.call(window.Promise) !== '[object Function]') {
    window.Promise = null;
  }
</script>









  












  
  
    <script type="text/javascript" src="/essay/lib/jquery/index.js?v=2.1.3"></script>
  

  
  
    <script type="text/javascript" src="/essay/lib/fastclick/lib/fastclick.min.js?v=1.0.6"></script>
  

  
  
    <script type="text/javascript" src="/essay/lib/jquery_lazyload/jquery.lazyload.js?v=1.9.7"></script>
  

  
  
    <script type="text/javascript" src="/essay/lib/velocity/velocity.min.js?v=1.2.1"></script>
  

  
  
    <script type="text/javascript" src="/essay/lib/velocity/velocity.ui.min.js?v=1.2.1"></script>
  

  
  
    <script type="text/javascript" src="/essay/lib/fancybox/source/jquery.fancybox.pack.js?v=2.1.5"></script>
  


  


  <script type="text/javascript" src="/essay/js/src/utils.js?v=5.1.4"></script>

  <script type="text/javascript" src="/essay/js/src/motion.js?v=5.1.4"></script>



  
  

  
  <script type="text/javascript" src="/essay/js/src/scrollspy.js?v=5.1.4"></script>
<script type="text/javascript" src="/essay/js/src/post-details.js?v=5.1.4"></script>



  


  <script type="text/javascript" src="/essay/js/src/bootstrap.js?v=5.1.4"></script>



  


  




	





  





  












  





  

  

  

  
  

  

  

  

</body>
</html>
